﻿using System.Linq;
using System.Web.Mvc;
using AutoMapper;
using Guan.CMS.Data.Repositories;
using Guan.CMS.Model.Entities;
using Guan.CMS.Web.ViewModels;
using Guan.CMS.Web.ViewModels.Page;

namespace Guan.CMS.Web.Controllers
{
    public class AboutUsController : Controller
    {
        private readonly ISiteConfigRepository _siteConfigRepository;
        public AboutUsController(ISiteConfigRepository siteConfigRepository)
        {
            this._siteConfigRepository = siteConfigRepository;
        }
        public ActionResult Index()
        {
            var config = this._siteConfigRepository.GetList().FirstOrDefault();
            var vm = new AboutusViewModel {Content = config.AboutUs};
            return View(vm);
        }
    }
}